from langgraph.config import get_stream_writer
from langchain_core.runnables import RunnableConfig
from uuid import uuid4

from app.graph.BaseNode import BaseNode
from app.graph.state import State


class NodeWeather(BaseNode):
    def __call__(self, state: State, config: RunnableConfig):
        writer = get_stream_writer()
        writer(self.new_streaming_token(id=uuid4().hex, type="C", token="天气不错"))
        return {}
